# Contributor: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
# Maintainer: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
pkgname=py3-openant
pkgver=0.4
pkgrel=0
pkgdesc="Python library to communicate with ANT-FS compliant devices"
url="https://github.com/Tigge/openant"
arch="noarch"
license="MIT"
depends="python3 py3-usb udev"
makedepends="py3-setuptools"
checkdepends="py3-pytest"
source="$pkgname-$pkgver.tar.gz::https://github.com/Tigge/openant/archive/v$pkgver/openant-$pkgver.tar.gz
	0001-Remove-udev-install.patch
	no-tests.patch
	"
builddir="$srcdir/openant-$pkgver"

build() {
	python3 setup.py build
}

check() {
	python3 -m pytest
}

package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir"

	install -Dm644 "$builddir"/resources/ant-usb-sticks.rules -t "$pkgdir"/usr/lib/udev/rules.d/
}

sha512sums="
7749fbdbdcfc1f226c7eb6d0a0b93f97034b80072c7662825e1b38e610a1a7a992fb928eafcb53b2748f83e244f3ce16813738001096776ef7c14fc955cc75e3  py3-openant-0.4.tar.gz
cebaf12e842d83ca84311c92c0b318644fb54fcba3164b0237b453eb0af0876622f520f1e290ce15ba64aa851d8dc2172c7e82d99052ad0424725e0883facf16  0001-Remove-udev-install.patch
b1f682287aca1a9fb36315b069314e95f5eef87761585dc2cef3cebb2b4e05d044a6298b142da97165d50a9aabc457522f6ac66748ece7d0bcb8e194310398b5  no-tests.patch
"
